<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/24
 * Time: 16:09
 */

namespace app\shop\model;


use think\Model;

class MoneyModel extends Model
{
    protected $table = 'dp_money_log';

    public static function getList($user_id='', $page, $pageSize)
    {
        $list = self::where('user_id', $user_id)->page($page,$pageSize)->select();
        return $list;
    }

    public static function store($user_id, $type, $value, $desc)
    {
        $data = [
            'user_id' => $user_id,
            'type' => $type,                // 1：加  2：减
            'value' => $value,
            'desc' => $desc,
            'time' => time()
        ];
        return self::insert($data);
    }
}